<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ include file="/page/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@ include file="/adapter/adapter-bootstrap.jsp" %>
</head>
<script type="text/javascript">

checkit   =   true;     
function   SelectAll()     
{     
   var chkAll =   document.getElementsByName("chkAll");     
    if   (checkit)     
    {     
    for   (var i=0;i<chkAll.length;i++)     
      chkAll.item(i).checked=true;     
      checkit   =   false;     
    }     
    else     
    {     
    for   (i=0;i<chkAll.length;i++)     
      chkAll.item(i).checked=false;     
      checkit   =   true;     
    }     
}


function  checkAll(){
	
}
function  addModules(){
	var str="";
    var chkAll =   document.getElementsByName("chkAll");     
	for(var i=0;i<chkAll.length;i++){
	  if(chkAll[i].checked==true) 
		  str=str+chkAll[i].value+",";  
	}
	str=str.substring(0,str.length-1);
	//alert(str);
	if(str!=""){
		window.location.href="${ctx}/appFrameModule/insertAppFrameModule?appid=${appid}&str="+str;
	}else{
        alert("请选择模块！");
	}
	
}

</script>
<body>
<div class="panel panel-default">
   <div class="panel-heading">
      <h3 class="panel-title">
          请输入查询条件
      </h3>
   </div>
   <div class="panel-body">
<form class="form-horizontal" role="form" id="modulelistForm" name="modulelistForm" action="${pageContext.request.contextPath }/plupmodule/modulelist?update=1&appid=${appid}" method="post">
                       <div class="form-group">
                          <label class="col-xs-1 control-label" for="ds_username">模块编号</label>
                          <div class="col-xs-3">
                             <input class="form-control" id="moduleid" name="moduleid" value="${moduleid}" type="text"/>
                          </div>
                          <label class="col-xs-1 control-label" for="ds_password">模块名称</label>
                          <div class="col-xs-3">
 									<input class="form-control" id="modulename" name="modulename"  value="${modulename}" type="text"/>
                          </div>
                          <div class="col-xs-3">
                          	 <button  type="submit" class="btn btn-default" >查询</button>                          
                          </div>
                       </div>
            
   </div>
</div>

	
<%-- 			<div class="ps-btn-opt">
				<input type="button" class="btn btn-default" value="创建模块"  onclick="Utils.forward('${ctx}/apps/input');"/> 
			</div>	 --%>
			<div class="ps-btn-opt">
<%-- 				<input type="button" class="btn btn-default" value="添加"  onclick="Utils.forward('${ctx}/apps/input');"/>  --%>
                <input type="button" class="btn btn-default" value="添加"  onclick="addModules();"/>
				<input type="button" class="btn btn-default" value="返回"  onclick="window.history.back(-1);"/> 
			</div>	
			<br>
			<table class="table table-bordered" style="" width="100%" cellspacing="1" cellpadding="0" border="0">
				<thead>
					<tr>
					    <th style="text-align: center;"><input name="chkAll" type="checkbox" value="" onclick="SelectAll();" />全选</th>
						<th>模块编号</th>
						<th>模块名称<span><input type="hidden" name="fieldName" value="username" disabled="disabled"/> </span></th>
						<th>模块首页</th>
						<th>操作选项</th>
					</tr>
				</thead>				
				<tbody>
				<c:forEach items="${modulelist}" var="moduleEntity">
				<tr align="center">
				            <td><input name="chkAll" type="checkbox" value="${moduleEntity.module_id}" onclick="" /></td>
							<td>${moduleEntity.module_id}</td>
							<td>${moduleEntity.module_name}</td>
							<td>${moduleEntity.module_index_page_id}</td>
							<td>
							
								<a href="${pageContext.request.contextPath }/plupmodule/moduleDetail?id=${moduleEntity.module_id}" class="pn-opt">模块详情</a>
							</td>
						</tr>  				
				</c:forEach> 						
				</tbody>
			</table>
			<%@ include file="/page/page.jsp" %>
			
		</form>
<%@ include file="/page/foot.html" %>
